import BuffUtil from '@/BuffUtil';
import UnitSpellEvent from '@/event/UnitSpellEvent';
export default class Item_半边龙虾壳 {
    static id = 'Acjk';
    static 名称: string = '半边龙虾壳';
    static 描述: string = '反伤！反伤！还是TM的反伤！';
    static 图标: string = 'assets\\item\\INV_Ammo_FireTar.blp';
    static buffId: string = 'buff_item_longxiake';
    static buffType: AppBuffType = {
        id: 'buff_item_longxiake',
        name: Item_半边龙虾壳.名称,
        ubertip: Item_半边龙虾壳.描述,
        art: Item_半边龙虾壳.图标,
        dur: 15,
        targetAttach: 'origin',
        targetArt: 'Abilities\\Spells\\NightElf\\ThornsAura\\ThornsAura.mdl',
    };
    static 释放(x: number, y: number, 来源?: unit, 目标?: unit, d?: any) {
        BuffUtil.addBuff(来源, Item_半边龙虾壳.buffId, 来源);
    }
    constructor() {
        BuffUtil.registerBuffType(Item_半边龙虾壳.buffType);
        se.onUnitSpellEffect(Item_半边龙虾壳.spellEffect, Item_半边龙虾壳.id);
        EventManager.onTakeAttack(Item_半边龙虾壳.attackEffect);
    }
    static attackEffect(d: DamageEventData) {
        if (!BuffUtil.hasUnitBuff(d.target, Item_半边龙虾壳.buffId)) return;
        let dmg = 50 + d.lastDamage * 0.77;
        DamageSystemInstance.applyReflectDamage(d.source, d.target, dmg);
    }
    static spellEffect(this: void, d: UnitSpellEvent) {
        Item_半边龙虾壳.释放(d.spellTargetX, d.spellTargetY, d.trigUnit, d.spellTargetUnit, d);
    }
}
